6597988c84516768b587c297f43eff6d7834c7a5,src/main/java/com/pinterest/secor/uploader/S3UploadManager.java,S3UploadManager,upload,#LogFilePath#,119

Before Change


        String s3Bucket = mConfig.getS3Bucket();
        // add MD5 hash to the prefix to have proper partitioning of the secor logs on s3
        String md5Hash = FileUtil.getMd5Hash(localPath.getTopic(), localPath.getPartitions());
        String s3Key = localPath.withPrefix(md5Hash + "/" + mConfig.getS3Path()).getLogFilePath();
        File localFile = new File(localPath.getLogFilePath());

        // make upload request, taking into account configured options for encryption

After Change


    public Handle<?> upload(LogFilePath localPath) throws Exception {
        String s3Bucket = mConfig.getS3Bucket();
        String s3Key = null;
        if (mConfig.getS3MD5HashPrefix()) {
       // add MD5 hash to the prefix to have proper partitioning of the secor logs on s3
          String md5Hash = FileUtil.getMd5Hash(localPath.getTopic(), localPath.getPartitions());
          s3Key = localPath.withPrefix(md5Hash + "/" + mConfig.getS3Path()).getLogFilePath();
        }
        else {
          s3Key = localPath.withPrefix(mConfig.getS3Path()).getLogFilePath();
        }
        File localFile = new File(localPath.getLogFilePath());